/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * jfWindows.java
 *
 * Created on 10/10/2011, 02:18:36
 */
package visao;

import java.io.IOException;
import java.text.DecimalFormat;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.management.AttributeNotFoundException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import mbeanserver.MBServer;
import util.Computer;
import util.ThreadMBeanMemoria;

/**
 *
 * @author alan
 */
public class jfWindows extends javax.swing.JDialog {

    MBeanServerConnection JMXSC;
    DefaultListModel modeloLista = new DefaultListModel();
    Computer pc;
    ObjectName windows;
    MBServer mbserver;
    Thread mbeanMemoria;
    jfNMS aThis;

    public jfWindows(MBeanServerConnection JMXSC, jfNMS aThis) {
        initComponents();
        this.setLocationRelativeTo(this);
        try {
            this.aThis = aThis;
            this.aThis.setEnabled(false);
            jbPararMemoria.setEnabled(false);
            this.JMXSC = JMXSC;
            windows = new ObjectName("tcc:type=MACHINEWINDOWS");

            /*
             * impressora
             */
            String impressora = (String) JMXSC.getAttribute(windows, "Impressora");
            jtaImpressora.setText(impressora);

            /*
             * sistema Operacional
             */
            String OS = (String) JMXSC.getAttribute(windows, "SistemaOperacional");
            String versao = (String) JMXSC.getAttribute(windows, "oSVersion");
            String arquitetura = (String) JMXSC.getAttribute(windows, "ArquiteturaOS");
            String serial = (String) JMXSC.getAttribute(windows, "SerialNumber");
            /*
             * memória
             */
            Long memTotal = null;
            Long memLivre = null;
            Long memOcupada = null;
            try {
                memTotal = (Long) JMXSC.getAttribute(windows, "MemoriaTotal");
                memLivre = (Long) JMXSC.getAttribute(windows, "MemoriaLivre");
                memOcupada = (Long) JMXSC.getAttribute(windows, "MemoriaOcupada");
            } catch (Exception e) {
            }


            jtfArquitetura.setText(arquitetura);
            jtfOS.setText(OS);
            jtfVersao.setText(versao);
            jtfSerial.setText(serial);
            jtfMemTotal.setText(memTotal != null ? memTotal.toString() : "");
            jtfMemOcupada.setText(memOcupada != null ? memOcupada.toString() : "");
            jtfMemLivre.setText(memLivre != null ? memLivre.toString() : "");

            /*
             * serviços execução
             */
            String serviçosExec = (String) JMXSC.getAttribute(windows, "RunningServicos");
            jtaServicosExec.setText(serviçosExec);

            /*
             * serviços Parados
             */
            String servicosParados = (String) JMXSC.getAttribute(windows, "StoppedServicos");
            jtaServicosParado.setText(servicosParados);

            /*
             * Aplicações
             */
//            String aplicacoes = (String) JMXSC.getAttribute(windows, "Aplicacoes");
//            jtaAplicacoes.setText(aplicacoes);

            /*
             * Processos
             */
            String a = (String) JMXSC.getAttribute(windows, "Processos");
            jtaProcessos.setText(a);

            /*
             * processador
             */
            String nome = (String) JMXSC.getAttribute(windows, "Processador");
            String frequencia = (String) JMXSC.getAttribute(windows, "Frequencia");
            String nucleo = (String) JMXSC.getAttribute(windows, "NumeroNucleos");
            String nucleoLogico = (String) JMXSC.getAttribute(windows, "NumeroNucleosLogico");

            jtfNomeProcessador.setText(nome);
            jtfFrequencia.setText(frequencia + " Mhz");
            jtfNumeroNucleo.setText(nucleo);
            jtfNumeroNucleoLog.setText(nucleoLogico);

            /*
             * unidade de disco 
             */

            String cUnidade = null;
            String cValor = null;
            int contUnid = 1;
            int contValor = 3;
            int contInterno = 1;


            /*
             * Letra de unidades
             */

            String letra = (String) JMXSC.getAttribute(windows, "VolumeUnidDisco");
            for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
                String token = stringTokenizer.nextToken();
                if (token.contains(":")) {
                    jtaLetraUnid.append(token + "\n");
                }
            }

            /*
             * Letra de unidades e espaço livre
             */
            for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
                String token = stringTokenizer.nextToken();
                if (contInterno == contUnid) {
                    cUnidade = token;
                    contUnid += 4;
                }
                if (contInterno == contValor) {
                    cValor = token;
                    contValor += 4;
                    Double valor = new Double(cValor.replace(',', '.'));
                    DecimalFormat df = new DecimalFormat("###.##");
                    jtaEspacoLivre.append(cUnidade + " " + df.format(valor) + " GB \n");
                }
                contInterno++;
            }

            /*
             * Letra de unidade e espaço Total
             */
            contUnid = 1;
            contValor = 2;
            contInterno = 1;
            cUnidade = "";
            cValor = "";
            for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
                String token = stringTokenizer.nextToken();
                if (contInterno == contUnid) {
                    cUnidade = token;
                    contUnid += 4;
                }
                if (contInterno == contValor) {
                    cValor = token;
                    contValor += 4;
                    Double valor = new Double(cValor.replace(',', '.'));
                    DecimalFormat df = new DecimalFormat("###.##");
                    jtaEspacoTotal.append(cUnidade + " " + df.format(valor) + " GB \n");
                }
                contInterno++;
            }

            /*
             * Letra unidade e sistema de arquivo
             */
            contUnid = 1;
            contValor = 4;
            contInterno = 1;
            cUnidade = "";
            cValor = "";
            for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
                String token = stringTokenizer.nextToken();
                if (contInterno == contUnid) {
                    cUnidade = token;
                    contUnid += 4;
                }
                if (contInterno == contValor) {
                    cValor = token;
                    contValor += 4;
                    jtaSistemaArq.append(cUnidade + " " + cValor + " \n");
                }
                contInterno++;
            }
        } catch (MalformedObjectNameException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        } catch (NullPointerException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        } catch (MBeanException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        } catch (AttributeNotFoundException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        } catch (InstanceNotFoundException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        } catch (ReflectionException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(this, "Problemas com a conexão");
        }

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jpDisco = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtaLetraUnid = new javax.swing.JTextArea();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtaEspacoTotal = new javax.swing.JTextArea();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jtaEspacoLivre = new javax.swing.JTextArea();
        jPanel17 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jtaSistemaArq = new javax.swing.JTextArea();
        jbAtualizarDisco = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jpProcessador = new javax.swing.JPanel();
        Nome = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jtfNomeProcessador = new javax.swing.JTextField();
        jtfFrequencia = new javax.swing.JTextField();
        jtfNumeroNucleo = new javax.swing.JTextField();
        jtfNumeroNucleoLog = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jtaProcessos = new javax.swing.JTextArea();
        jbAtualizarProcessos = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jtaAplicacoes = new javax.swing.JTextArea();
        jbAtualizarProgramas = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jPanel15 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jtaServicosParado = new javax.swing.JTextArea();
        jPanel16 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jtaServicosExec = new javax.swing.JTextArea();
        jbAtaulizarServiços = new javax.swing.JButton();
        jpSO = new javax.swing.JPanel();
        jpOS = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jtfOS = new javax.swing.JTextField();
        jtfVersao = new javax.swing.JTextField();
        jtfArquitetura = new javax.swing.JTextField();
        jlSerial = new javax.swing.JLabel();
        jtfSerial = new javax.swing.JTextField();
        jpMemoria = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jtfMemTotal = new javax.swing.JTextField();
        jtfMemOcupada = new javax.swing.JTextField();
        jtfMemLivre = new javax.swing.JTextField();
        jbMemAtualiza = new javax.swing.JButton();
        jbPararMemoria = new javax.swing.JButton();
        jPanel21 = new javax.swing.JPanel();
        jPanel22 = new javax.swing.JPanel();
        jScrollPane10 = new javax.swing.JScrollPane();
        jtaImpressora = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });
        getContentPane().setLayout(new java.awt.FlowLayout());

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações de Gerência"));

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Letra de unidade de disco"));

        jtaLetraUnid.setColumns(20);
        jtaLetraUnid.setRows(5);
        jtaLetraUnid.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtaLetraUnidMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jtaLetraUnid);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Espaço Total"));

        jtaEspacoTotal.setColumns(20);
        jtaEspacoTotal.setRows(5);
        jScrollPane3.setViewportView(jtaEspacoTotal);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Espaço Livre"));

        jtaEspacoLivre.setColumns(20);
        jtaEspacoLivre.setRows(5);
        jScrollPane4.setViewportView(jtaEspacoLivre);

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder("Sistema de arquivo"));

        jtaSistemaArq.setColumns(20);
        jtaSistemaArq.setRows(5);
        jScrollPane9.setViewportView(jtaSistemaArq);

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
                .addContainerGap())
        );

        jbAtualizarDisco.setText("Atualizar informações de disco");
        jbAtualizarDisco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAtualizarDiscoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jpDiscoLayout = new javax.swing.GroupLayout(jpDisco);
        jpDisco.setLayout(jpDiscoLayout);
        jpDiscoLayout.setHorizontalGroup(
            jpDiscoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDiscoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpDiscoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpDiscoLayout.createSequentialGroup()
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jpDiscoLayout.createSequentialGroup()
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jbAtualizarDisco, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jpDiscoLayout.setVerticalGroup(
            jpDiscoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpDiscoLayout.createSequentialGroup()
                .addGroup(jpDiscoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpDiscoLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpDiscoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbAtualizarDisco)
                .addGap(94, 94, 94))
        );

        jTabbedPane1.addTab("Disco Rígido", jpDisco);

        jpProcessador.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações do Processador"));
        jpProcessador.setAutoscrolls(true);

        Nome.setText("Nome");

        jLabel2.setText("Frequência");

        jLabel3.setText("Número de núcleo físico");

        jLabel4.setText("Número de núcleo Lógico");

        jtfNomeProcessador.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtfNomeProcessadorMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jpProcessadorLayout = new javax.swing.GroupLayout(jpProcessador);
        jpProcessador.setLayout(jpProcessadorLayout);
        jpProcessadorLayout.setHorizontalGroup(
            jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpProcessadorLayout.createSequentialGroup()
                .addGroup(jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpProcessadorLayout.createSequentialGroup()
                        .addComponent(Nome)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfNomeProcessador, javax.swing.GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE))
                    .addGroup(jpProcessadorLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfFrequencia, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpProcessadorLayout.createSequentialGroup()
                            .addComponent(jLabel4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jtfNumeroNucleoLog))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpProcessadorLayout.createSequentialGroup()
                            .addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtfNumeroNucleo, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jpProcessadorLayout.setVerticalGroup(
            jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpProcessadorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Nome)
                    .addComponent(jtfNomeProcessador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jtfFrequencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jtfNumeroNucleo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpProcessadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jtfNumeroNucleoLog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(407, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpProcessador, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpProcessador, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Processador", jPanel4);

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder("Processos do Sistema"));

        jtaProcessos.setColumns(20);
        jtaProcessos.setRows(5);
        jtaProcessos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtaProcessosMouseClicked(evt);
            }
        });
        jScrollPane6.setViewportView(jtaProcessos);

        jbAtualizarProcessos.setText("Atualizar Processos");
        jbAtualizarProcessos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAtualizarProcessosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jbAtualizarProcessos, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)
                .addGap(7, 7, 7)
                .addComponent(jbAtualizarProcessos)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Processos", jPanel5);

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("Aplicações"));

        jtaAplicacoes.setColumns(20);
        jtaAplicacoes.setRows(5);
        jtaAplicacoes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtaAplicacoesMouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jtaAplicacoesMousePressed(evt);
            }
        });
        jScrollPane5.setViewportView(jtaAplicacoes);

        jbAtualizarProgramas.setText("Atualizar Aplicações");
        jbAtualizarProgramas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAtualizarProgramasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE)
                    .addComponent(jbAtualizarProgramas, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbAtualizarProgramas)
                .addContainerGap(42, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Aplicações instaladas", jPanel11);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 89, Short.MAX_VALUE)
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder("Serviços Parados"));

        jtaServicosParado.setColumns(20);
        jtaServicosParado.setRows(5);
        jtaServicosParado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtaServicosParadoMouseClicked(evt);
            }
        });
        jScrollPane7.setViewportView(jtaServicosParado);

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Serviços em execução"));

        jtaServicosExec.setColumns(20);
        jtaServicosExec.setRows(5);
        jtaServicosExec.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtaServicosExecMouseClicked(evt);
            }
        });
        jScrollPane8.setViewportView(jtaServicosExec);

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
                .addContainerGap())
        );

        jbAtaulizarServiços.setText("Atualizar serviços");
        jbAtaulizarServiços.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAtaulizarServiçosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jbAtaulizarServiços))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbAtaulizarServiços)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Serviços", jPanel6);

        jpOS.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações do sistema operacional"));

        jLabel1.setText("Sistema Operacional");

        jLabel5.setText("Versão");

        jLabel6.setText("Arquitetura");

        jtfOS.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtfOSMouseClicked(evt);
            }
        });

        jtfVersao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtfVersaoActionPerformed(evt);
            }
        });

        jlSerial.setText("Serial");

        javax.swing.GroupLayout jpOSLayout = new javax.swing.GroupLayout(jpOS);
        jpOS.setLayout(jpOSLayout);
        jpOSLayout.setHorizontalGroup(
            jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpOSLayout.createSequentialGroup()
                .addGroup(jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpOSLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtfOS, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE))
                    .addGroup(jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpOSLayout.createSequentialGroup()
                            .addComponent(jLabel6)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtfArquitetura))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpOSLayout.createSequentialGroup()
                            .addComponent(jLabel5)
                            .addGap(18, 18, 18)
                            .addComponent(jtfVersao, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jpOSLayout.createSequentialGroup()
                        .addComponent(jlSerial)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtfSerial, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jpOSLayout.setVerticalGroup(
            jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpOSLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jtfOS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jtfVersao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jtfArquitetura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpOSLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlSerial)
                    .addComponent(jtfSerial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        jpMemoria.setBorder(javax.swing.BorderFactory.createTitledBorder("Informações de memória (MB)"));
        jpMemoria.setAutoscrolls(true);

        jLabel7.setText("Memória Total");

        jLabel8.setText("Memória Ocupada");

        jLabel9.setText("Memória Livre");

        jbMemAtualiza.setText("Iniciar o Gerenciamento");
        jbMemAtualiza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbMemAtualizaActionPerformed(evt);
            }
        });

        jbPararMemoria.setText("Parar Gerenciamento");
        jbPararMemoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbPararMemoriaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jpMemoriaLayout = new javax.swing.GroupLayout(jpMemoria);
        jpMemoria.setLayout(jpMemoriaLayout);
        jpMemoriaLayout.setHorizontalGroup(
            jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpMemoriaLayout.createSequentialGroup()
                .addGroup(jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jpMemoriaLayout.createSequentialGroup()
                            .addComponent(jLabel7)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtfMemTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jpMemoriaLayout.createSequentialGroup()
                            .addComponent(jLabel8)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jtfMemOcupada))
                        .addGroup(jpMemoriaLayout.createSequentialGroup()
                            .addComponent(jLabel9)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jtfMemLivre)))
                    .addGroup(jpMemoriaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jbMemAtualiza)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbPararMemoria)))
                .addContainerGap(320, Short.MAX_VALUE))
        );
        jpMemoriaLayout.setVerticalGroup(
            jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpMemoriaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jtfMemTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtfMemOcupada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jtfMemLivre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpMemoriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbMemAtualiza)
                    .addComponent(jbPararMemoria))
                .addContainerGap(202, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jpSOLayout = new javax.swing.GroupLayout(jpSO);
        jpSO.setLayout(jpSOLayout);
        jpSOLayout.setHorizontalGroup(
            jpSOLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpSOLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpSOLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jpMemoria, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jpOS, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpSOLayout.setVerticalGroup(
            jpSOLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpSOLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpOS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jpMemoria, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Sistema Operacional", jpSO);

        jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder("Impressoras instaladas"));

        jtaImpressora.setColumns(20);
        jtaImpressora.setRows(5);
        jtaImpressora.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtaImpressoraMouseClicked(evt);
            }
        });
        jScrollPane10.setViewportView(jtaImpressora);

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(309, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Impressora", jPanel21);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 651, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 608, Short.MAX_VALUE)
                .addContainerGap())
        );

        getContentPane().add(jPanel2);

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jtaLetraUnidMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaLetraUnidMouseClicked
}//GEN-LAST:event_jtaLetraUnidMouseClicked

private void jtfNomeProcessadorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtfNomeProcessadorMouseClicked
}//GEN-LAST:event_jtfNomeProcessadorMouseClicked

private void jtaProcessosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaProcessosMouseClicked
}//GEN-LAST:event_jtaProcessosMouseClicked

private void jtaAplicacoesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaAplicacoesMouseClicked
}//GEN-LAST:event_jtaAplicacoesMouseClicked

private void jtaAplicacoesMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaAplicacoesMousePressed
}//GEN-LAST:event_jtaAplicacoesMousePressed

private void jtaServicosParadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaServicosParadoMouseClicked
}//GEN-LAST:event_jtaServicosParadoMouseClicked

private void jtaServicosExecMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaServicosExecMouseClicked
}//GEN-LAST:event_jtaServicosExecMouseClicked

private void jtfOSMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtfOSMouseClicked
}//GEN-LAST:event_jtfOSMouseClicked

private void jtfVersaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtfVersaoActionPerformed
}//GEN-LAST:event_jtfVersaoActionPerformed

private void jbMemAtualizaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbMemAtualizaActionPerformed
    mbeanMemoria = new Thread(new ThreadMBeanMemoria(windows, JMXSC, jtfMemOcupada, jtfMemLivre));
    mbeanMemoria.start();
    jbMemAtualiza.setEnabled(false);
    jbPararMemoria.setEnabled(true);

}//GEN-LAST:event_jbMemAtualizaActionPerformed

private void jtaImpressoraMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtaImpressoraMouseClicked
}//GEN-LAST:event_jtaImpressoraMouseClicked

private void jbPararMemoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbPararMemoriaActionPerformed
    Thread.State a = mbeanMemoria.getState();

    mbeanMemoria.stop();
    jbMemAtualiza.setEnabled(true);
    jbPararMemoria.setEnabled(false);
}//GEN-LAST:event_jbPararMemoriaActionPerformed

private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
    this.aThis.setEnabled(true);
}//GEN-LAST:event_formWindowClosing

private void jbAtaulizarServiçosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAtaulizarServiçosActionPerformed
    try {
        /*
         * serviços execução
         */
        String serviçosExec = (String) JMXSC.getAttribute(windows, "RunningServicos");
        jtaServicosExec.setText(serviçosExec);

        /*
         * serviços Parados
         */
        String servicosParados = (String) JMXSC.getAttribute(windows, "StoppedServicos");
        jtaServicosParado.setText(servicosParados);
    } catch (MBeanException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (AttributeNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstanceNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ReflectionException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    }
}//GEN-LAST:event_jbAtaulizarServiçosActionPerformed

private void jbAtualizarProgramasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAtualizarProgramasActionPerformed
    try {
        /*
         * Aplicações
         */
        String aplicacoes = (String) JMXSC.getAttribute(windows, "Aplicacoes");
        jtaAplicacoes.setText(aplicacoes);
    } catch (MBeanException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (AttributeNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstanceNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ReflectionException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    }
}//GEN-LAST:event_jbAtualizarProgramasActionPerformed

private void jbAtualizarProcessosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAtualizarProcessosActionPerformed
    try {
        /*
         * Processos
         */
        String a = (String) JMXSC.getAttribute(windows, "Processos");
        jtaProcessos.setText(a);
    } catch (MBeanException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (AttributeNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstanceNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ReflectionException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    }
}//GEN-LAST:event_jbAtualizarProcessosActionPerformed

private void jbAtualizarDiscoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAtualizarDiscoActionPerformed
    try {
        jtaLetraUnid.setText("");
        jtaEspacoLivre.setText("");
        jtaSistemaArq.setText("");
        jtaEspacoTotal.setText("");

        /*
         * unidade de disco 
         */

        String cUnidade = null;
        String cValor = null;
        int contUnid = 1;
        int contValor = 3;
        int contInterno = 1;


        /*
         * Letra de unidades
         */

        String letra = (String) JMXSC.getAttribute(windows, "VolumeUnidDisco");
        for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
            String token = stringTokenizer.nextToken();
            if (token.contains(":")) {
                jtaLetraUnid.append(token + "\n");
            }
        }

        /*
         * Letra de unidades e espaço livre
         */
        for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
            String token = stringTokenizer.nextToken();
            if (contInterno == contUnid) {
                cUnidade = token;
                contUnid += 4;
            }
            if (contInterno == contValor) {
                cValor = token;
                contValor += 4;
                Double valor = new Double(cValor.replace(',', '.'));
                DecimalFormat df = new DecimalFormat("###.##");
                jtaEspacoLivre.append(cUnidade + " " + df.format(valor) + " GB \n");
            }
            contInterno++;
        }

        /*
         * Letra de unidade e espaço Total
         */
        contUnid = 1;
        contValor = 2;
        contInterno = 1;
        cUnidade = "";
        cValor = "";
        for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
            String token = stringTokenizer.nextToken();
            if (contInterno == contUnid) {
                cUnidade = token;
                contUnid += 4;
            }
            if (contInterno == contValor) {
                cValor = token;
                contValor += 4;
                Double valor = new Double(cValor.replace(',', '.'));
                DecimalFormat df = new DecimalFormat("###.##");
                jtaEspacoTotal.append(cUnidade + " " + df.format(valor) + " GB \n");
            }
            contInterno++;
        }

        /*
         * Letra unidade e sistema de arquivo
         */
        contUnid = 1;
        contValor = 4;
        contInterno = 1;
        cUnidade = "";
        cValor = "";
        for (StringTokenizer stringTokenizer = new StringTokenizer(letra); stringTokenizer.hasMoreTokens();) {
            String token = stringTokenizer.nextToken();
            if (contInterno == contUnid) {
                cUnidade = token;
                contUnid += 4;
            }
            if (contInterno == contValor) {
                cValor = token;
                contValor += 4;
                jtaSistemaArq.append(cUnidade + " " + cValor + " \n");
            }
            contInterno++;
        }
    } catch (MBeanException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (AttributeNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstanceNotFoundException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ReflectionException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(jfWindows.class.getName()).log(Level.SEVERE, null, ex);
    }
}//GEN-LAST:event_jbAtualizarDiscoActionPerformed
    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//
//
//
//
//
//
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(jfWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(jfWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(jfWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(jfWindows.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new jfWindows().setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Nome;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbAtaulizarServiços;
    private javax.swing.JButton jbAtualizarDisco;
    private javax.swing.JButton jbAtualizarProcessos;
    private javax.swing.JButton jbAtualizarProgramas;
    private javax.swing.JButton jbMemAtualiza;
    private javax.swing.JButton jbPararMemoria;
    private javax.swing.JLabel jlSerial;
    private javax.swing.JPanel jpDisco;
    private javax.swing.JPanel jpMemoria;
    private javax.swing.JPanel jpOS;
    private javax.swing.JPanel jpProcessador;
    private javax.swing.JPanel jpSO;
    private javax.swing.JTextArea jtaAplicacoes;
    private javax.swing.JTextArea jtaEspacoLivre;
    private javax.swing.JTextArea jtaEspacoTotal;
    private javax.swing.JTextArea jtaImpressora;
    private javax.swing.JTextArea jtaLetraUnid;
    private javax.swing.JTextArea jtaProcessos;
    private javax.swing.JTextArea jtaServicosExec;
    private javax.swing.JTextArea jtaServicosParado;
    private javax.swing.JTextArea jtaSistemaArq;
    private javax.swing.JTextField jtfArquitetura;
    private javax.swing.JTextField jtfFrequencia;
    private javax.swing.JTextField jtfMemLivre;
    private javax.swing.JTextField jtfMemOcupada;
    private javax.swing.JTextField jtfMemTotal;
    private javax.swing.JTextField jtfNomeProcessador;
    private javax.swing.JTextField jtfNumeroNucleo;
    private javax.swing.JTextField jtfNumeroNucleoLog;
    private javax.swing.JTextField jtfOS;
    private javax.swing.JTextField jtfSerial;
    private javax.swing.JTextField jtfVersao;
    // End of variables declaration//GEN-END:variables
}
